@extends('layouts.admin')
@section('css')
<link rel="stylesheet" type="text/css" href="{{ asset('admin/assets/bootstrap-fileupload/bootstrap-fileupload.css') }}" />
@endsection
@section('content')
<section id="main-content">
          <section class="wrapper">
              <!-- page start-->
             
              <div class="row">
               <div class="col-sm-12">
                  <section class="panel">
                      
                      <div class="panel-body">
                          <a href="{{ route('admin.wechat.reply') }}" type="button" class="btn btn-info ">文字回复</a>
                              <a href="{{ route('admin.wechat.reply.news') }}" type="button" class="btn btn-primary ">图文回复</a>
                 
                      </div>
                      </section>
              </div>
                  <div class="col-lg-12">
                      <section class="panel">
                          <header class="panel-heading">
                              编辑图文回复
                          </header>
                          <div class="panel-body">
                                @if (count($errors) > 0)
                                <div class="alert alert-block alert-danger fade in">
                                  <button data-dismiss="alert" class="close close-sm" type="button">
                                      <i class="icon-remove"></i>
                                  </button>
                                  <!-- <strong>Oh snap!</strong> Change a few things up and try submitting again. -->
                                   <ul>
                                        @foreach ($errors->all() as $error)
                                        <li>{{ $error }}</li> 
                                        @endforeach
                                    </ul>
                              </div>
                              @endif
                              <form class="form-horizontal" action="{{ route('admin.wechat.reply.update',['id'=>$reply->id])}}" role="form" method="POST" enctype="multipart/form-data">
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">规则名称</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="Name" name="name" value="{{ $reply->name }}" placeholder="Name">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">关键字</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="Keyword" name="keyword" value="{{ $reply->keyword }}" placeholder="Keyword">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">正则表达式</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="Regular" name="regular" value="{{ $reply->regular }}" placeholder="Regular">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">标题</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="title" name="title" value="{{ $reply->title }}" placeholder="Title">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  <div class="form-group last">
                                          <label class="control-label col-lg-2 col-sm-2 ">封面</label>
                                          <div class="col-lg-10">
                                              <div class="fileupload fileupload-new" data-provides="fileupload">
                                                  <div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
                                                      @if($reply->picurl)
                                                      <img src="{{ asset($reply->picurl) }}" alt="" />
                                                      @else
                                                      <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt="" />
                                                       
                                                      @endif
                                                  </div>
                                                  <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
                                                  <div>
                                                   <span class="btn btn-white btn-file">
                                                   <span class="fileupload-new"><i class="icon-paper-clip"></i> Select image</span>
                                                   <span class="fileupload-exists"><i class="icon-undo"></i> Change</span>
                                                   <input type="file" class="default" name="picurl" />
                                                   </span>
                                                      <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload"><i class="icon-trash"></i> Remove</a>
                                                  </div>
                                              </div>
                                              <span class="label label-danger">注意!</span>
                                             <span>
                                             只支持火狐、谷歌、Safari及IE10等新版浏览器
                                             </span>
                                          </div>
                                      </div>
                                  <div class="form">

                                              <div class="form-group">
                                                  <label class="col-sm-2 control-label col-sm-2">描述</label>
                                                  <div class="col-sm-10">
                                                      <textarea class="form-control ckeditor" name="description" rows="6">{{ $reply->description }}</textarea>
                                                  </div>
                                              </div>
                                   
                                      </div>
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">外部链接</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="url" name="url" value="{{ $reply->url }}" placeholder="Url">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <div class="col-lg-offset-2 col-lg-10">
                                            {{ csrf_field() }}
                                            <input type="hidden" class="form-control" id="msgtype" name="msgtype" value="news" />
                                          <button type="submit" class="btn btn-danger">提交</button>
                                      </div>
                                  </div>
                                  
                              </form>
                          </div>
                      </section>
                      
                  </div>
              </div>

             
              <!-- page end-->
          </section>
      </section>
@endsection
@section('javascript')
 @parent
  <!-- <script type="text/javascript" src="{{ asset('backend/assets/ckeditor/ckeditor.js') }}"></script> -->
  <script type="text/javascript" src="{{ asset('admin/assets/bootstrap-fileupload/bootstrap-fileupload.js') }}"></script>
   <!-- <script src="{{ asset('backend/js/advanced-form-components.js') }}"></script> -->

<!-- <script src="{{ asset('backend/js/form-component.js') }}"></script> -->
@endsection

